<script language="javascript">
{literal}
jQuery(document).ready(function() {
	jQuery("#created_time_from").datepicker();
	jQuery("#created_time_to").datepicker();
  });
 
function check_uncheck(form_name){		
	var frm_name = eval("document."+form_name);
	for (var i = 0; i < frm_name.elements.length; i++) {
		if (frm_name.elements[i].type == "checkbox") {			
			frm_name.elements[i].checked = (frm_name.list_item_0.checked==true)?true:false;
		}
	}
}
</script>
{/literal} 
<div style="border:1px solid #CCCCCC; font-size:12px; font-family:Arial">
 {if $msg}
	<center>
		<div style="width:600px;font-size:13px">{$msg}</div>
	</center>
{/if}
<table width="100%" cellspacing="0" cellpadding="2" bordercolor="#CCCCCC" border="1" class="uad_table">
	<tr bgcolor="#F0F0F0">
		<td colspan="8">
		<div style="margin-left:50px; font-size:23px;font-weight:bold;float:left"><h1><a href="user.html">Quản trị thành viên </a>{if $is_root}[ <a href="user.html?cmd=add">Thêm mới</a> ]{/if}</h1>

        </div>

		</td>
	</tr>
	<tr>
		<td colspan="8" bgcolor="#F0F0F0" align="left">
			<table width="100%" cellspacing="0" cellpadding="2" bordercolor="#CCCCCC" border="1" class="uad_table">
					<tbody>
					   <tr>
							<td width="9%" align="right">Trạng thái:</td>
				  			<td colspan="5">
							<div style="float:left; width:70px">
								<input  {if $block=="all"} checked="checked" {/if} id="block" type="radio" name="block" value="all"/><label for="block" style="cursor:pointer">Tất cả</label></div>
								<div style="float:left; width:120px">
								<input id="block1" type="radio" name="block" value="no" {if $block=="no"}checked="checked" {/if}/><label for="block1" style="cursor:pointer">Không bị khóa</label></div>
								<div style="float:left; width:120px">
								<input id="block12" type="radio" name="block" value="yes" {if $block=="yes"} checked="checked" {/if}/><label for="block12" style="cursor:pointer">Bị khóa</label></div>
								</td>						
					  	</tr>	
						<tr>
							<td width="9%" align="right">Tài khoản:</td>
				  			<td colspan="5">
							<div style="float:left; width:70px">
								<input  {if $active=="all"} checked="checked" {/if} id="active" type="radio" name="active" value="all"/><label for="active" style="cursor:pointer">Tất cả</label></div>
								<div style="float:left; width:90px">
								<input id="active1" type="radio" name="active" value="active" {if $active=="active"}checked="checked" {/if}/><label for="active1" style="cursor:pointer">Kích hoạt</label></div>
								<div style="float:left; width:120px">
								<input id="active2" type="radio" name="active" value="unactive" {if $active=="unactive"} checked="checked" {/if}/><label for="active2" style="cursor:pointer">Chưa kích hoạt</label></div>
								</td>						
					  	</tr>	
						<tr>
							<td width="9%" align="right">Tìm kiếm:</td>
				  			<td width="12%"><input type="text" value="{$search}" name="search" id="search"></td>						
				 			<td align="left" colspan="4">							
								<div style="float:left; width:50px">
								<input id="type_search1" type="radio" name="type_search" value="user_id" {if $type_search=="user_id"} checked="checked" {/if}/><label for="type_search1" style="cursor:pointer">ID</label></div>
								<div style="float:left; width:70px">
								<input id="type_search2" type="radio" name="type_search" value="user_email" {if $type_search=="user_email"} checked="checked" {/if}/><label for="type_search2" style="cursor:pointer">Email</label></div>
								<div style="float:left; width:80px">
								<input id="type_search3" type="radio" name="type_search" value="full_name" {if $type_search=="full_name"} checked="checked" {/if}/><label for="type_search3" style="cursor:pointer">Họ Tên</label></div>
								<div style="float:left; width:75px">
								<input id="type_search4" type="radio" name="type_search" value="mobile_phone" {if $type_search=="mobile_phone"} checked="checked" {/if}/><label for="type_search4" style="cursor:pointer">Mobile</label></div>
								<div style="float:left; width:75px">
								<input id="type_search5" type="radio" name="type_search" value="reg_ip" {if $type_search=="reg_ip"} checked="checked" {/if}/><label for="type_search5" style="cursor:pointer">Reg IP</label></div>
								<div style="float:left; width:85px">
								<input id="type_search6" type="radio" name="type_search" value="last_ip" {if $type_search=="last_ip"} checked="checked" {/if}/><label for="type_search6" style="cursor:pointer">Login IP</label></div>
								<div style="float:left; width:75px">
								<input id="type_search7" type="radio" name="type_search" value="all" {if $type_search=="all"} checked="checked" {/if}/><label for="type_search7" style="cursor:pointer">Tất cả</label></div>
							</td>							
					  	</tr>					
						<tr>
			              <td align="right">Từ ngày:</td>
			                <td><input type="text" name="created_time_from" id="created_time_from" value="{$created_time_from}" /></td>
			                <td align="right" width="8%">đến ngày:</td>
			                <td width="14%"><input type="text" name="created_time_to" id="created_time_to" value="{$created_time_to}" /></td>
			                <td colspan="2">							
							<div style="float:left; width:85px">
								<input id="date_type_search1" type="radio" name="date_type_search" value="create_time" {if $date_type_search=="create_time"} checked="checked" {/if}/><label for="date_type_search1" style="cursor:pointer">Đăng ký</label></div>
								<div style="float:left; width:100px">
							<input id="date_type_search2" type="radio" name="date_type_search" value="last_login" {if $date_type_search=="last_login"} checked="checked" {/if}/><label for="date_type_search2" style="cursor:pointer">Đăng nhập</label></div>														
						</td>
						</tr>
						<tr>
							{*<td align="right">Công ty:</td>
								<td>
									<select name="cpn_id" style="width:140px">
										<option value="0">Chọn Công ty</option>
										{$arr_cpn}
									</select>
									</td>
								<td align="right" width="6%">Account VIP:</td>
								<td width="14%">
									<select name="vip_id">
										<option value="-1">Tất cả</option>
										{$arr_vip}
									</select>
								</td>*}
								<td colspan="2" align="right">
								<input type="submit" value="Tìm kiếm">
							</td>
							<td colspan="2"></td>
						</tr>
			           </tbody>
			      </table>
		</td>
	</tr>
    <tr>
		<td colspan="8">
			<div class="product-list-paging" style="margin: 0px; padding: 0px;">				
				<div>{$paging}</div>
			</div>
		</td>
	</tr>
	{if $admin_can_edit}
    	<tr bgcolor="#FFF"><td colspan="8"><input type="submit" value="Khóa vĩnh viễn" onclick="return confirm('Bạn sẽ khóa các thành viên đã chọn?')"></td></tr>
	{/if}

    <tr bgcolor="#FFF">
 	  <td width="15" align="center"><input onClick="check_uncheck('ListUserAdminForm');" name="chk_ids" type="checkbox" id="list_item_0" value="1" title="Chọn tất cả"  style="cursor:pointer"></td>
      <td width="60" align="center"><strong>ID</strong></td>
      <td width="100"  align="center"><strong>Ảnh</strong></td>
      <td align="left"><strong>Thông tin cá nhân</strong></td>
      <td width="100" align="center"><strong>IP</strong></td>
	  <td width="120" align="center"><strong>Thời gian</strong></td>
	  {if $admin_can_edit}
          <td width="140" align="center"><strong>Kích hoạt</strong></td>
          <td width="95" align="center"><strong>Thao tác</strong></td>
	  {/if}
 	</tr>

	{if $items}
        {foreach from=$items item=items}
        <tr id="row_{$items.id}" bgcolor="#FFF" class="user_hover_row"  >
          <td align="center"><input name="chk_id[]" type="checkbox" id="{$items.id}" value="{$items.id}" style="cursor:pointer"></td>
          <td align="center">{$items.id}</td>
          <td align="center">{if ($items.avatar_url != '')}<a href="user.html?user_id={$items.id}&cmd=edit&href="><img width="100px" src="{$server_img}/{$items.avatar_url}" alt="[Avatar Image]"></a><br>{/if}</td>
          <td align="left" valign="top">
            Email: <a href="user.html?user_id={$items.id}&cmd=edit">
                    {if $items.is_block}<strike>{/if}{$items.email}{if $items.is_block}</strike>{/if}</a><br />
            {if $items.full_name}
               Họ tên: {$items.full_name}<br />
            {/if}

            {if $items.mobile_phone}Mobile: {$items.mobile_phone}<br />{/if}
          </td>
            <td align="left" valign="top">
                {if $items.reg_ip}Reg IP: {$items.reg_ip}{/if}
                {if $items.last_ip}{if $items.reg_ip} - {/if}Last IP: {$items.last_ip}<br />
                    {else}<br />{/if}
            </td>

          {**}
          <td align="left" valign="top">
              {if $items.create_time}Reg: {$items.create_time}<br />{/if}
              {if $items.last_login}Login: {$items.last_login}<br />{/if}
              {if $items.is_block}
                {if $items.block_time==-1}
                    <font color="red">Khóa vĩnh viễn</font>
                {else}
                    <font color="red">Lock: {$items.block_time}</font>
                {/if}<br />
                {if $items.admin_lock}Người khóa: {$items.admin_lock}<br />{/if}
                {if $items.time_lock}Time khóa: {$items.time_lock}<br />{/if}
                {if $items.reason_lock}Lý do khóa: {$items.reason_lock}{/if}<br />
            {/if}
          </td>

          {if $admin_can_edit}
          <td align="center" valign="top">
             {if $items.is_active==1}
                <b><font color="green">Yes</font></b>==>
                <a href="{$items.un_active}">[Unactive]</a><br />
                {if $items.is_block}
                    <a href="javascript: un_ban_nick_user({$items.id}, '{$items.email}')">[Unlock]</a>
                {else}
                <a href="javascript: ban_nick_user({$items.id}, '{$items.email}')">[Lock]</a>
                <a href="javascript: resetPas({$items.id}, '{$items.email}')"> - [Reset Pas]</a>
                {/if}
             {else}
                <b><font color="red">No</font></b>==>
                <a href="{$items.active}">[Active]</a><br />
                <a href="javascript: admin_send_email_active({$items.id}, '{$items.email}')">[Send email active]</a>
             {/if}
          </td>
          <td align="center">
            <table cellpadding="2" cellspacing="0" style="margin:0px">
               <tr>
                  <td><a title="Xóa cache thành viên" href="{$items.del_cache}"><img src="style/images/admin/reload.png" align="center" border="0"></a></td>
                  <td><a target="_blank" title="Xem tin của thành viên" href="member-{$items.id}.html"><img src="style/images/admin/view_ads.gif" align="center" border="0"></a></td>
                  <td>{if $is_root}<a title="Xoá thành viên" href = "javascript:void(0)" onclick="return del_user({$items.id})">
                  <img src="style/images/admin/delete.gif" alt="Xóa thành viên {$items.email}" align="center" border="0" /></a>{/if}</td>
               </tr>
             </table>
          </td>
          {/if}
  	</tr>
	{/foreach}	
	<tr><td colspan="6"><div class="product-list-paging" style="margin: 0px; padding: 0px;">{$paging}</div></td></tr>
	{else}
	<tr><td align="center" height="50" colspan="6">Không có dữ liệu với điều kiện tìm kiếm</td></tr>
	{/if}
</table>
</div>
{literal}	
<style type="text/css">

</style>

{/literal}